//
//  ZYResourceCircleTowCell.m
//  优学荟管理系统
//
//  Created by edz on 2017/11/8.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ZYResourceCircleTowCell.h"
#import "ZYResourceCircleTowModel.h"
@implementation ZYResourceCircleTowCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    
    
    return self;
    
    
}




- (void)assignByZYResourceCircleTowModel:(ZYResourceCircleTowModel *)model{
    
    self.couseLabel.text = [NSString stringWithFormat:@"课程：%@",model.name];
    self.rmbLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.price doubleValue]];
    self.couseTimeLabel.text = [NSString stringWithFormat:@"课时：%@课时",model.courseCount];
    self.numberOfApplicantsLabel.text = [NSString stringWithFormat:@"报名人数：%@人",model.enrollCount];
    
//    self.paymentEvaluationLabel.text = [NSString stringWithFormat:@"缴费评价:%@元",[model.resourceMain valueForKey:@"totalSettleMoneyPay"]];
//    self.paymentNoEvaluationLabel.text = [NSString stringWithFormat:@"暂无缴费有评价:%@元",[model.resourceMain valueForKey:@"totalSettleMoneyNotPay"]];
    
    self.commentLabel.text = [NSString stringWithFormat:@"评价总次数:%@次",[model.resourceMain valueForKey:@"threeCommentCountPay"]];
    self.commentNoLabel.text = [NSString stringWithFormat:@"评价总次数:%@次",[model.resourceMain valueForKey:@"threeCommentCountNotPay"]];
    
    self.effectiveEvaluationLabel.text = [NSString stringWithFormat:@"有效评价总次数:%@次",[model.resourceMain valueForKey:@"validThreeCommentCountPay"]];
    self.effectiveNoEvaluationLabel.text = [NSString stringWithFormat:@"有效评价总次数:%@次",[model.resourceMain valueForKey:@"validThreeCommentCountNotPay"]];
    
    self.seeTimeLabel.text = [NSString stringWithFormat:@"查看总次数:%@次",[model.resourceMain valueForKey:@"totalViewCountPay"]];
    self.seeTimeNoLabel.text = [NSString stringWithFormat:@"查看总次数:%@次",[model.resourceMain valueForKey:@"totalViewCountNotPay"]];
    
    
}

















- (void)setUpSuperView{
    
    self.couseLabel = [UILabel new];
    //    self.couseLabel.backgroundColor = [UIColor redColor];
    self.couseLabel.textColor = ColorRGB(102, 102, 102);
    self.couseLabel.font = [UIFont systemFontOfSize:15];
    self.couseLabel.numberOfLines = 0;
    [self.contentView addSubview:self.couseLabel];
    
    
    self.rmbLabel = [UILabel new];
    //    self.rmbLabel.backgroundColor = [UIColor redColor];
    self.rmbLabel.textColor = ColorRGB(247,76,76);
    self.rmbLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.rmbLabel];
    
    
    self.couseTimeLabel = [UILabel new];
    //    self.couseTimeLabel.backgroundColor = [UIColor redColor];
    self.couseTimeLabel.textColor = ColorRGB(153,153,153);
    self.couseTimeLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.couseTimeLabel];
    
    
    self.numberOfApplicantsLabel = [UILabel new];
    //    self.numberOfApplicantsLabel.backgroundColor = [UIColor redColor];
    self.numberOfApplicantsLabel.textColor = ColorRGB(153,153,153);
    self.numberOfApplicantsLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.numberOfApplicantsLabel];
    
    
    self.commentLabel = [UILabel new];
    //    self.commentLabel.backgroundColor = [UIColor redColor];
    self.commentLabel.textColor = ColorRGB(153,153,153);
    self.commentLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.commentLabel];
    
    self.seeTimeLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.seeTimeLabel.textColor = ColorRGB(153,153,153);
    self.seeTimeLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.seeTimeLabel];
    
    self.effectiveEvaluationLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.effectiveEvaluationLabel.textColor = ColorRGB(153,153,153);
    self.effectiveEvaluationLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.effectiveEvaluationLabel];
    
    
    self.paymentEvaluationLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.paymentEvaluationLabel.textColor = ColorRGB(51,51,51);
    self.paymentEvaluationLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.paymentEvaluationLabel];
    
    
  
    
    
    self.paymentNoEvaluationLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.paymentNoEvaluationLabel.textColor = ColorRGB(51,51,51);
    self.paymentNoEvaluationLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.paymentNoEvaluationLabel];
    
    
    self.commentNoLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.commentNoLabel.textColor = ColorRGB(153,153,153);
    self.commentNoLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.commentNoLabel];
    
    self.effectiveNoEvaluationLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.effectiveNoEvaluationLabel.textColor = ColorRGB(153,153,153);
    self.effectiveNoEvaluationLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.effectiveNoEvaluationLabel];
    
    
    
    self.seeTimeNoLabel = [UILabel new];
    //    self.seeTimeLabel.backgroundColor = [UIColor redColor];
    self.seeTimeNoLabel.textColor = ColorRGB(153,153,153);
    self.seeTimeNoLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.seeTimeNoLabel];
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    self.couseLabel.text = @"课程：全老师奥数学课100天";
    [self.couseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.top.offset(15);
        make.right.equalTo(self).offset(-120);
    }];
    
    
    self.rmbLabel.text = @"¥111111";
    [self.rmbLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-10);
        make.top.offset(15);
    }];
    
    self.couseTimeLabel.text = @"课时：24课时";
    [self.couseTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.couseLabel);
        make.top.equalTo(self.couseLabel.mas_bottom).offset(10);
        
    }];
    
    
    self.numberOfApplicantsLabel.text = @"报名人数：40人";
    [self.numberOfApplicantsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-20);
        make.top.centerY.equalTo(self.couseTimeLabel);
    }];
    
    
    
//    @property (nonatomic,strong) UILabel *commentLabel;//评论
//    @property (nonatomic,strong) UILabel *seeTimeLabel;//查看次数
//    @property (nonatomic,strong) UILabel *effectiveEvaluationLabel;//有效评价总次数
//    @property (nonatomic,strong) UILabel *paymentEvaluationLabel;//缴费评价

    
    
    self.paymentEvaluationLabel.text = @"缴费评价：";
    
    [self.paymentEvaluationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.couseTimeLabel);
        make.top.equalTo(self.couseTimeLabel.mas_bottom).offset(10);
    }];
    
    
    
    
    
    self.commentLabel.text = @"评论总次数：1000";
    [self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.paymentEvaluationLabel);
        make.top.equalTo(self.paymentEvaluationLabel.mas_bottom).offset(10);
    }];
    
    
    self.effectiveEvaluationLabel.text = @"有效评价总次数：100次";
    
    [self.effectiveEvaluationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.right.equalTo(self).offset(-20);
        make.top.centerY.equalTo(self.commentLabel);
        
        
    }];
    
    
    
    
    
    
    
//    self.seeTimeLabel.text = @"查看总次数：5499";
//    [self.seeTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//
//        make.left.equalTo(self.commentLabel);
//        make.top.equalTo(self.commentLabel.mas_bottom).offset(10);
//
//    }];
    
    UILabel *lineLabel = [UILabel new];
    
    lineLabel.backgroundColor = ColorRGB(245, 245, 245);
    [self.contentView addSubview:lineLabel];
    
    [lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.top.equalTo(self.effectiveEvaluationLabel.mas_bottom).offset(15);
        make.width.offset(kScreenWidth);
        make.height.offset(1);
    }];
    
    
    
    
    
    
    
    
//    @property (nonatomic,strong) UILabel *paymentNoEvaluationLabel;//暂无缴费评价
//    @property (nonatomic,strong) UILabel *commentNoLabel;//评价总次数 暂无
//    @property (nonatomic,strong) UILabel *effectiveNoEvaluationLabel;//有效评价总次数 暂无
//    @property (nonatomic,strong) UILabel *seeTimeNoLabel;//查看总次数 暂无

    
    
    self.paymentNoEvaluationLabel.text = @"暂无缴费评价:";
    [self.paymentNoEvaluationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.paymentEvaluationLabel);
        make.top.equalTo(lineLabel.mas_bottom).offset(15);
    }];
    
    
    
    self.commentNoLabel.text = @"评价总次数：100次";

    [self.commentNoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.paymentNoEvaluationLabel);
        make.top.equalTo(self.paymentNoEvaluationLabel.mas_bottom).offset(10);


    }];





    self.effectiveNoEvaluationLabel.text = @"有效评价总次数：100次";
    [self.effectiveNoEvaluationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-20);
        make.top.centerY.equalTo(self.commentNoLabel);
    }];


//    self.seeTimeNoLabel.text = @"查看总次数：100次";
//    [self.seeTimeNoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.commentNoLabel);
//        make.top.equalTo(self.commentNoLabel.mas_bottom).offset(10);
//    }];



    UILabel *lineTowLabel = [UILabel new];

    lineTowLabel.backgroundColor = ColorRGB(245, 245, 245);
    [self.contentView addSubview:lineTowLabel];

    [lineTowLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.top.equalTo(self.effectiveNoEvaluationLabel.mas_bottom).offset(15);
        make.width.offset(kScreenWidth);
        make.height.offset(5);
    }];




    
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(lineTowLabel).offset(5);
    }];
    
}






@end
